Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

has-yarn

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-yarn

Check if a project is using Yarn

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is has-yarn?

The has-yarn npm package is a simple utility that checks if a project is using Yarn as its package manager by looking for a 'yarn.lock' file in the project directory. It is useful for tooling and scripts that need to adapt their behavior based on the package manager being used.

What are has-yarn's main functionalities?

Check if Yarn is being used

This feature allows you to check if a project is using Yarn by invoking the hasYarn function. It returns true if a 'yarn.lock' file is found in the project directory, indicating that Yarn is being used.

const hasYarn = require('has-yarn');

if (hasYarn()) {
  console.log('The project uses Yarn.');
} else {
  console.log('The project does not use Yarn.');
}

Other packages similar to has-yarn

Keywords

FAQs

Package last updated on 10 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc